<html>

<head>
<meta http-equiv="Content-Language" content="en-us">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Script Descriptions of pointers.f90</title>
</head>

<body>

<h1 align="center">&nbsp; Short description of the script in pointer.f90</h1>
<dl>
  <dd>
  <p align="left"><font color="#0000FF"><b>In bold blue I list the keywords.</b>
  <i><b>The keywords in italic are experimental things which change according to 
  needs at KEK. </b></i></font><font color="#FF0000">In red are the needed 
  input. </font>Sometimes you see part of the code needed to read the input 
  written in black. <font color="#33CC33">Finally, I put comments in green,
  </font></dd>
</dl>
<div align="left">
  To run this script, the MAD-X file madx_ptc_script.f90 of Piotr should be as 
  displayed here: <a href="script.htm">please click.</a></div>
<p>&nbsp;</p>

<ol>
  <li><font color="#0000FF">&nbsp;</font><span style="text-transform: uppercase"><b><font size="4" color="#0000FF">SELECT LAYOUT
  </font><font size="4">or </font><font size="4" color="#0000FF">SELECT 
  LATTICE</font></b><br>
  <font size="2" color="#FF0000">&nbsp;i_layout_temp&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  </font><font size="2" color="#33CC33">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  Position in mad_universe m_u</font></span></li>
  <li><span style="text-transform: uppercase"><font color="#0000FF"><b>
  <font size="4">ALLOCATE BETA</font>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  </font><font color="#33CC33">Array used in storing beta for Splitting 
  comparison</font></span></li>
  <li><font color="#0000FF" size="4">
  <span style="text-transform: uppercase; font-weight:700">DEALLOCATE BETA</span></font></li>
  <li><span style="text-transform: uppercase"><font color="#0000FF">&nbsp;<b><font size="4">FILL BETA</font></b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  </font><font color="#33CC33">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  array beta is filled with beta11 and beta22</font><font color="#0000FF"><br>
  </font><font size="2" color="#FF0000">&nbsp;ib&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  </font><font size="2" color="#33CC33">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  1 for ultra-splitted lattice and 2 for resplitted lattice: ib=1 is used as a 
  reference</font></span></li>
  <li><span style="text-transform: uppercase"><font color="#0000FF">&nbsp;<b><font size="4">FIT BENDS</font></b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  </font><font color="#33CC33">Fitting of the bend orbit to (0,0) using bn(1) 
  when drift-kick is used in&nbsp; with exact_model = true</font></span></li>
  <li><span style="text-transform: uppercase"><font color="#0000FF">&nbsp;<b><font size="4">THIN LENS</font></b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  </font><font color="#33CC33">&nbsp;Thin resplitting algorithm</font><br>
&nbsp;<font size="2" color="#FF0000">THIN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  </font><font size="2" color="#33CC33">&nbsp;K*L/thin&nbsp; gives the 
  approximate number of steps&nbsp; per magnet</font></span></li>
  <li><span style="text-transform: uppercase"><font color="#0000FF">&nbsp;<b><font size="4">even THIN LENS</font></b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  </font><font color="#33CC33">&nbsp;Thin resplitting algorithm</font><br>
&nbsp;<font size="2" color="#FF0000">THIN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  </font><font size="2" color="#33CC33">&nbsp;same as </font><font color="#0000FF">
  <b><font size="2">THIN LENS</font></b>
  </font><font size="2" color="#33CC33">with even number of steps of integration 
  enforced</font></span></li>
  <li><span style="text-transform: uppercase"><font color="#0000FF">&nbsp;<font size="4"><b>odd</b></font><b><font size="4"> THIN LENS</font></b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  </font><font color="#33CC33">&nbsp;Thin resplitting algorithm</font><br>
&nbsp;<font size="2" color="#FF0000">THIN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  </font><font size="2" color="#33CC33">&nbsp;same as </font><font color="#0000FF">
  <b><font size="2">THIN LENS</font></b>
  </font><font size="2" color="#33CC33">with odd number of steps of integration 
  enforced</font></span></li>
  <li><span style="text-transform: uppercase; font-weight: 700">
  <font color="#0000FF" size="4">MAKE_THIN_LAYOUT or MAKE THIN LAYOUT </font>
  </span><span style="text-transform: uppercase"><font color="#33CC33">makes the 
  Thin structure for beam tracking inside a magnet. </font></span></li>
  <li><span style="text-transform: uppercase; font-weight: 700">
  <font color="#0000FF" size="4">allocate beams </font></span><span style="text-transform: uppercase"><font color="#0000FF">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  </font><font color="#33CC33">&nbsp;allocates my_beams(n_beams)</font><br>
  &nbsp;<font size="2" color="#FF0000">n_beams&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  </font><font size="2" color="#33CC33">&nbsp;</font></span></li>
  <li><span style="text-transform: uppercase; font-weight: 700">
  <font color="#0000FF" size="4">deallocate beams </font></span><span style="text-transform: uppercase"><font color="#0000FF">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  </font><font color="#33CC33">&nbsp;deallocates my_beams(n_beams)</font><font size="2" color="#FF0000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  </font><font size="2" color="#33CC33">&nbsp;</font></span></li>
  <li><span style="text-transform: uppercase"><font size="4" color="#0000FF">
  <span style="font-weight: 700">create </span></font></span>
  <span style="text-transform: uppercase; font-weight: 700">
  <font color="#0000FF" size="4">&nbsp;beam </font></span><span style="text-transform: uppercase"><font color="#0000FF">&nbsp;</font></span><span style="text-transform: uppercase; font-weight: 700"><font color="#0000FF" size="4">
  </font></span><span style="text-transform: uppercase"><font color="#0000FF">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  </font><br>
  <font size="2" color="#FF0000">use_beam,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  NUMBER_OF_PARTICLE, FILENAME&nbsp;&nbsp;&nbsp; </font>
  <font size="2" color="#33CC33">&nbsp;(FILENAME=no means no map to read)</font><font size="2" color="#FF0000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  </font><font size="2" color="#33CC33">&nbsp;</font><font size="2"><br>
&nbsp;<font color="#FF0000">cut , sig(1:6)&nbsp;&nbsp;&nbsp;&nbsp; </font>
  <font color="#33CC33">cut for gaussian and sigmas </font> <br>
&nbsp;IF(FILENAME(1:2)=='NO') THEN&nbsp;&nbsp;&nbsp; <br>
&nbsp; CALL create_PANCAKE(MY_BEAMS(USE_BEAM),NUMBER_OF_PARTICLE,CUT,SIG,my_ring%start%t1)<br>
  ELSE&nbsp;&nbsp; <font color="#33CC33">&nbsp;! reading a map my_A from 
  filename</font><br>
&nbsp;&nbsp; CALL kanalnummer(mfr)<br>
  OPEN(UNIT=MFR,FILE=FILENAME)<br>
&nbsp;&nbsp; READ(MFR,*) MY_A_NO,MY_A_ND<br>
&nbsp; CALL INIT(MY_A_NO,MY_A_ND,0,0)<br>
&nbsp; CALL ALLOC(MY_A)<br>
&nbsp; CALL READ(MY_A,MFR) <br>
&nbsp; CALL create_PANCAKE(MY_BEAMS(USE_BEAM),N_BEAM,CUT,SIG,my_ring%start%t1,MY_A)
  <br>
&nbsp; CALL KILL(MY_A)<br>
&nbsp; Close(mfr)<br>
  ENDIF</font></span></li>
  <li><span style="text-transform: uppercase"><font size="4" color="#0000FF">
  <span style="font-weight: 700">copy </span></font></span>
  <span style="text-transform: uppercase; font-weight: 700">
  <font color="#0000FF" size="4">&nbsp;beam </font></span><span style="text-transform: uppercase"><font color="#0000FF">&nbsp;</font></span><span style="text-transform: uppercase; font-weight: 700"><font color="#0000FF" size="4">
  </font></span><span style="text-transform: uppercase"><font color="#0000FF">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  </font><br>
  <font size="2" color="#FF0000">i1, i2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  </font><font size="2" color="#33CC33">copies MY_BEAMS(I1)&nbsp; into 
  MY_BEAMS(I2)</font></span></li>
  <li><span style="text-transform: uppercase"><font size="4" color="#0000FF">
  <span style="font-weight: 700">gaussian </span></font></span>
  <span style="text-transform: uppercase; font-weight: 700">
  <font color="#0000FF" size="4">&nbsp;Seed </font></span><span style="text-transform: uppercase"><font color="#0000FF">&nbsp;</font></span><span style="text-transform: uppercase; font-weight: 700"><font color="#0000FF" size="4">
  </font></span><span style="text-transform: uppercase"><font color="#0000FF">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  </font><br>
  <font size="2" color="#FF0000">i1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  </font><font size="2" color="#33CC33">&nbsp; integer seed for gaussian 
  distribution</font></span></li>
  <li><span style="text-transform: uppercase"><font color="#0000FF"><b>
  <font size="4">random multipole</font></b>&nbsp; </font><font color="#33CC33">Sets Polymorphic families for TPSA fits</font><font color="#0000FF"><br>
  </font><font size="2" color="#FF0000">name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  </font><font size="2" color="#33CC33">&nbsp;! name of family</font><br>
  <font color="#FF0000" size="2">n,cns,cn</font><font size="2"><font color="#FF0000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  </font><font color="#33CC33">&nbsp;! n=2 means quad, n&lt;0 skew&nbsp;&nbsp; cns=systematic 
  part&nbsp;&nbsp; cn= random part</font><font color="#FF0000"><br>
  </font></font>
  <font size="2" color="#FF0000">&nbsp;addi,integrated&nbsp;&nbsp; </font>
  <font size="2" color="#33CC33">! addi=0,1 overwrites or added on top /&nbsp; 
  integrated=true or false (integrated strength)</font><font size="2" color="#FF0000"><br>
  cut&nbsp;&nbsp; </font>
  <font size="2" color="#33CC33">! sigma cut for the gaussian distribution</font></span></li>
  <li><span style="text-transform: uppercase"><font color="#0000FF"><b>
  <font size="4">MISALIGN EVERYTHING&nbsp; </font></b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  </font><font color="#33CC33">&nbsp;the name says it all!</font><font color="#0000FF"><br>
  </font><font size="2" color="#FF0000">sigma(1:6), cut&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  ! sig(1:3)=position x,y,z&nbsp;&nbsp; sig(4:6)=angles,&nbsp; cut of gaussian</font></span></li>
  <li><span style="text-transform: uppercase"><font color="#0000FF"><b>
  <font size="4">SET FAMILIES&nbsp; </font></b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  </font><font color="#33CC33">&nbsp;Sets Polymorphic families for TPSA fits</font><font color="#0000FF"><br>
  </font><font size="2" color="#FF0000">NPOL</font><br>
  <font size="2">DO J=1,NPOL<br>
&nbsp;&nbsp;&nbsp; READ(MF,*) <font color="#FF0000">NMUL , NAME </font> <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DO K=1,NMUL<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; READ(MF,*)<font color="#FF0000"> 
  N,ICN</font><br>
&nbsp; ENDDO<br>
  ENDDO</font></span></li>
  <li><span style="text-transform: uppercase"><font color="#0000FF"><b>
  <font size="4">DEALLOCATE FAMILIES&nbsp;</font></b>&nbsp;&nbsp;
  </font><font color="#33CC33">Deallocates families allocated in Set Families</font></span></li>
  <li><span style="text-transform: uppercase"><font color="#0000FF">&nbsp;<b><font size="4">FIT TUNE&nbsp;&nbsp;&nbsp;</font></b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  </font><font color="#33CC33">Fit Fractional tunes</font><font color="#0000FF"><br>
  </font>&nbsp;<font size="2">&nbsp;<font color="#FF0000">&nbsp;&nbsp; epsf&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  </font><font color="#33CC33">accuracy of the fit </font><font color="#FF0000"><br>
  </font></font><font color="#FF0000" size="2">&nbsp;&nbsp;&nbsp;&nbsp; 
  fractional_targ_tune(1:2)&nbsp;&nbsp;&nbsp;&nbsp; </font>
  <font size="2" color="#33CC33">Targets&nbsp; tunes. If first one negative, 
  uses tunes computed using fill&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; beta with ib=1</font></span></li>
  <li><span style="text-transform: uppercase"><font color="#33CC33">&nbsp;</font><b><font color="#0000FF" size="4">SCAN 
  TUNE</font></b><font color="#33CC33"><br>
  </font>
  <font size="2" color="#FF0000">epsf</font><font size="2" color="#33CC33">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; accuracy of the fit <br>
  </font>
  <font size="2" color="#FF0000">nstep(2)&nbsp;</font><font size="2" color="#33CC33">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  number of steps in tune scans&nbsp; (NSTEP(2)=0 STRAIGHT LINE SCAN IN TUNE 
  SPACE)<br>
  </font>
  <font size="2" color="#FF0000">tune_ini(2),tune_fin (2)&nbsp;&nbsp;&nbsp;&nbsp;</font><font size="2" color="#33CC33">&nbsp;&nbsp;&nbsp; Initial 
  tunes a<br>
  </font>
  <font size="2" color="#FF0000">name_root,SUFFIX&nbsp;&nbsp;</font><font size="2" color="#33CC33">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  RESULTS PRINTED IN file name_root#.SUFFIX&nbsp;&nbsp;&nbsp; 
  (SUFFIX=CHARACTER*4)</font></span></li>
  <li><span style="text-transform: uppercase"><font color="#0000FF"><b>
  <font size="4">FIT CHROMATICITY&nbsp;</font></b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  </font><br>
  <font size="2" color="#FF0000">&nbsp;epsf&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  </font><font size="2"><font color="#FF0000">&nbsp; </font>
  <font color="#33CC33">accuracy of the fit </font></font>
  <font size="2" color="#FF0000"><br>
  targ_chrom(2)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  </font><font size="2" color="#33CC33">Targets</font></span></li>
  <li><span style="text-transform: uppercase"><font color="#0000FF"><b>
  <font size="4">GET 
  CHROMATICITY</font></b>&nbsp;&nbsp; </font><font color="#33CC33">&nbsp;Print 
  closed orbit, fractional tunes, Chromaticity</font></span></li>
  <li><span style="text-transform: uppercase"><i><font color="#0000FF" size="4">FIT SEXTUPOLE RESONANCE
  </font><font color="#0000FF" size="5"> <br>
  </font></i><font size="2" color="#FF0000">epsf, flag&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  </font><font size="2" color="#33CC33">Accuracy and (Flag=Vector field or 
  Poisson Bracket)</font><font size="2" color="#FF0000"><br>
  MRESO(3)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  </font><font size="2" color="#33CC33">&nbsp;mreso=(m<sub>1</sub>,m<sub>2</sub>,p)&nbsp;&nbsp;&nbsp;&nbsp; 
  where&nbsp; m1*nu1+m2*nu2=p</font><font size="2" color="#FF0000"><br>
&nbsp;targ_RES(3)</font></span></li>
  <li><span style="text-transform: uppercase"><font size="4" color="#0000FF"><i>
  pRINT</i></font><font color="#0000FF" size="4"><i> a IN RESONANCE&nbsp; </i>
  </font><font color="#33CC33">pRINT THE &quot;A&quot; SCRIPT IN RESONANCE BASIS</font><font color="#0000FF" size="5"><i><br>
  </i>
  </font><font color="#FF0000" size="2">MRES(1:4)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  </font><font color="#33CC33" size="2">&nbsp; rESONANCE TO BE PRINTED 
  SEPARATELY (M<sub>1</sub>-M<sub>2</sub>)*Q<sub>1</sub>+(M<sub>3</sub>-M<sub>4</sub>)*Q<sub>2</sub></font><font color="#FF0000" size="2"><br>
  NO,EMIT0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  </font><font color="#33CC33" size="2">Order of normal form and emittance for 
  scaling coefficients</font><font color="#FF0000" size="2"><br>
  FILENAME&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  </font><font color="#33CC33" size="2">file to print result</font></span></li>
  <li><span style="text-transform: uppercase"><i><font size="2" color="#0000FF">&nbsp;</font><font color="#0000FF" size="4">TRACK 
  4D NORMALIZED</font><font size="2" color="#0000FF"><br>
  </font></i><font size="2" color="#FF0000">IB</font><font size="2" color="#33CC33">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  (sEE </font><font size="2" color="#0000FF">fill beta</font><font size="2" color="#33CC33">)<br>
  </font><font size="2" color="#FF0000">POS,NTURN,itmax,resmax</font><font size="2" color="#33CC33">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pOSITION IN LATTICE, NUMBER OF TURNS, 
  number , number of steps in emmitance, resonances&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  printed to order resmax (numerically).<br>
  </font><font size="2" color="#FF0000">EMIT(1:2),APER(1:2),&nbsp;emit(3),emit(6) </font><font size="2" color="#33CC33">&nbsp;initial&nbsp; eMITTANCE TO TRACK 
  ,&nbsp; ACCEPTANCE AT APERTURE AT POSITION pos, step size for e_x and e_y<br>
  </font><font size="2" color="#FF0000">filename,filetune,FILESMEAR</font><font size="2" color="#33CC33">&nbsp;&nbsp;&nbsp; RESULTS IN FILENAME, 
  result of tunes and resonances, Smear of invariant</font></span></li>
  <li><span style="text-transform: uppercase"><font color="#0000FF">&nbsp;<i><font size="4">SCAN 
  TRACK 4D NORMALIZED</font></i></font><font size="2" color="#33CC33"><br>
  </font><font size="2" color="#FF0000">POS,NTURN,itmax,resmax</font><font size="2" color="#33CC33">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  sEE </font><font color="#0000FF" size="2">TRACK 4D NORMALIZED</font><font size="2" color="#33CC33"><br>
  </font><font size="2" color="#FF0000">EMIT(1:2),APER(1:2),&nbsp;emit(3),emit(6) </font><font size="2" color="#33CC33">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  sEE </font><font color="#0000FF" size="2">TRACK 4D NORMALIZED</font><font size="2" color="#33CC33"><br>
&nbsp;</font><font size="2" color="#FF0000">nscan,name_root,SUFFIX</font><font size="2" color="#33CC33">&nbsp;&nbsp;&nbsp;&nbsp; # of files to read, see
  </font><font color="#0000FF" size="2">&nbsp;SCAN TUNE</font><font size="2" color="#33CC33"><br>
  </font><font size="2" color="#FF0000">name_root_res,SUFFIX_res&nbsp;</font><font size="2" color="#33CC33"> result in file&nbsp; name_root_res#.SUFFIX_res 
  (tune and smear file also created)</font></span></li>
  <li><span style="text-transform: uppercase"><font size="4" color="#0000FF"><b>
  4D MAP </b></font><font color="#0000FF">&nbsp;&nbsp;</font><font size="2" color="#33CC33">cOMPUTES 
  A ND2=4&nbsp; MAP</font><font size="2" color="#33CC33"><br>
  </font><font size="2" color="#FF0000">NO </font><font size="2" color="#33CC33">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  oRDER OF MAP<br>
  </font><font size="2" color="#FF0000">POS, DEL&nbsp; </font><font size="2" color="#33CC33">&nbsp;&nbsp;&nbsp; 
  POSITION AND VALUE OF DELTA I.1., X(5).<br>
  </font><font size="2" color="#FF0000">filename &nbsp;</font><font size="2" color="#33CC33"> 
  mAP PRINTED&nbsp; in fileNAME&nbsp; </font></span></li>
  <li><span style="text-transform: uppercase"><font color="#0000FF"><b>
  <font size="4">pause</font></b><span style="font-variant: small-caps">...XXXXXXXXXXXX...&nbsp;</span>&nbsp;&nbsp;<font size="2">
  </font>
  </font><font size="2" color="#33CC33">A pause (XXXX ARE OPTIONAL COMMENTS 
  ADDED.)</font></span></li>
  <li><span style="text-transform: uppercase"><font color="#0000FF"><b>
  <font size="4">PRINT ONCE&nbsp;</font></b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font size="2">&nbsp;
  </font>
  </font><font size="2" color="#33CC33">Print Taylors using the Berz original Format</font></span></li>
  <li><font color="#0000FF"><span style="text-transform: uppercase"><b>
  <font size="4">PRINT TWICE&nbsp;</font></b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  </span></font><span style="text-transform: uppercase">
  <font color="#33CC33" size="2">
  Print Taylors using the stuttering format (mad-x default)</font></span></li>
  <li><span style="text-transform: uppercase"><b><font color="#0000FF">
  <font size="4">PRINTBNAN</font></font><font size="4"><font color="#33CC33">
  </font>OR<font color="#33CC33"> </font><font color="#0000FF">PRINTANBN</font><font color="#33CC33">
  </font>OR<font color="#33CC33"> </font><font color="#0000FF">PRINTBN</font><font color="#33CC33">
  </font>OR<font color="#33CC33"> </font><font color="#0000FF">PRINTAN</font></font></b><font color="#33CC33"><b><font size="4"><br>
  </font></b></font><font size="2" color="#FF0000">TITLE</font><font size="2" color="#33CC33">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  TITLE TO PUT AT THE BEGINNING OF THE FILE<br>
  </font><font size="2" color="#FF0000">nmul,filename&nbsp;&nbsp;&nbsp;&nbsp;</font><font size="2" color="#33CC33">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  # of multipoles to print (1=bend, 2=quad, etc...) and file name</font></span></li>
  <li><span style="text-transform: uppercase"><b><font color="#0000FF">
  <font size="4">READ BN AN</font></font><font size="4"><font color="#33CC33">
  </font>OR<font color="#33CC33"> </font><font color="#0000FF">READ AN BN</font><font color="#33CC33">
  </font>OR<font color="#33CC33"> </font><font color="#0000FF">READ BN</font><font color="#33CC33">
  </font>OR<font color="#33CC33"> </font></font><font size="4" color="#0000FF">READ AN<br>
  </font></b><font size="2" color="#33CC33">filename&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  Reverse from </font><font color="#0000FF" size="2">PRINTBNAN</font><font color="#33CC33">
  </font></span></li>
  <li><span style="text-transform: uppercase; font-weight: 700">
  <font size="4" color="#0000FF">PTC END</font><font color="#33CC33"> </font>OR<font color="#33CC33">
  </font><font color="#0000FF" size="4">END PTC </font></span><font size="4">
  <span style="text-transform: uppercase">OR</span></font><font color="#0000FF" size="4"><span style="text-transform: uppercase; font-weight: 700"> 
  APOCALYSPE </span></font><font color="#33CC33">
  <span style="text-transform: uppercase">a MAD-X COMMAND TO WIPE OUT ptc FROM 
  THIS EARTH</span></font></li>
  <li><span style="text-transform: uppercase"><b><font size="4" color="#0000FF">
  Thin example</font><font size="4" color="#33CC33">&nbsp; </font></b>
  <font color="#33CC33">Runs an example of the thin lens layout</font><font size="2" color="#33CC33"><br>
  </font><font size="2" color="#FF0000">i1,i2, filename</font><font size="2" color="#33CC33">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  Example from i1 to i2;&nbsp;&nbsp; results printed on <b>filename</b> unless
  <b>filename=screen</b></font></span></li>
  <li><span style="text-transform: uppercase"><b><font size="4" color="#0000FF">RETURN</font><font size="4"> 
  or </font></b> <font color="#0000FF"><b><font size="4">EXIT </b>
  </font><b>OR</b><font color="#0000FF"><b> QUIT</b></font></font><font color="#0000FF">&nbsp;&nbsp;<b><font size="4">&nbsp;</font></b></font><b><font size="4">OR<font color="#0000FF"> 
  END&nbsp;</font>OR</font></b><font color="#0000FF"><b><font size="4"> STOP</font></b>&nbsp;&nbsp;&nbsp;&nbsp;
  </font><font color="#33CC33">Returns control to main program (MAd-X or Gino)</font><br>
  <br>
  <br>
  <br>
  </span><br>
  <br>
&nbsp;</li>
</ol>

</body>

</html>